package com.xiejun;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;

@WebServlet(urlPatterns = "/test")
public class XiejunServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        System.out.println(req.getMethod());
//        resp.addHeader("content-Length", "12");
//        resp.addHeader("content-Type", "text/plain;charset=UTF-8");
        resp.getOutputStream().write("Hello, Xiejun!".getBytes()); //字节流
    }
}
